package com.ls.fw.web.core.servlet.utils;

import java.util.List;
import java.util.Map;


/**
 * 
 * @author Defender
 * 2014年1月7日 下午11:06:03
 */
public class ObjectUtil {

	public static boolean isNull(Object obj){
		return  obj==null?true:false;
	}
	
	public static boolean isNull(Object[] obj){
		return  obj==null?true:false;
	}
	
	public static boolean isEmpty(Object[] obj){
		return  obj==null?true:(obj.length==0);
	}
	
	public static boolean isEmpty(String[] obj){
		return  obj==null?true:(obj.length==0);
	}
	
	public static boolean isEmpty(String obj){
		return  obj==null ? true : (obj.toString().length()==0 ? true : false);
	}
	
	
	public static boolean isEmpty(Map<?, ?> obj){
		return  obj==null ? true : obj.isEmpty();
	}
	
	
	public static boolean isEmpty(List<?> obj){
		return  obj==null ? true : obj.isEmpty();
	}
	
	
	public static boolean isNotNull(Object obj){
		return  !isNull(obj);
	}
	
	public static boolean isNotEmpty(String obj){
		return  !isEmpty(obj);
	}
	
	
	public static boolean isNotEmpty(Map<?, ?> obj){
		return  !isEmpty(obj);
	}
	
	
	public static boolean isNotEmpty(List<?> obj){
		return  !isEmpty(obj);
	}
}
